-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Usage on GitHub Actions with xvfb #147
Comments
I had to clean up old xvfp processes but this method has been working for me: Haven't had a chance to play with browser-run yet in actions. |
fwiw, its an action https://github.com/marketplace/actions/cleanup-xvfb. Let me know how it goes if you try it out. |
Would it be possible to create an action that wraps Before - run: sudo apt-get install xvfb
- name: npm install, build, and test
run: |
npm i
xvfb-run --auto-servernum npm test
env:
CI: true
- name: Cleanup xvfb pidx
uses: bcomnes/cleanup-xvfb@v1 After - name: Test with xvfb
uses: run-with-xvfb
with:
run: npm test
env:
CI: true |
I recently set up xvfb with the "Before" method and it worked well. But yes that action looks really cool...I guess it would need to install |
I might give this a shot, but since it's your idea, if you want to, please go first! |
I’ve been using actions a bit more an the cleanup might not even be needed. Not sure what was happening before. Running in headless ci, you need to set up a frame buffer for chrome to work. Unless that responsibility is pulled into browser run, setting up per run is the way to go. |
Same for me, this currently works for headless electron: https://github.com/hypergraph-xyz/desktop/blob/master/.github/workflows/test.yml |
I just published an action like you suggested. To clean the process I used @bcomnes's script. I added an author header to it. Even tho the cleaning is not really necessary in practice, I wanted the action to feel isolated. Because I saw @juliangruber conditions his workflow based on platform I added that condition inside the action so your workflow ends up cleaner, if you're not using linux then the command will be executed without using xvfb. In this commit to @juliangruber's repo you guys can see the differences (what before was 7 lines, now can be done with 3). I added the action in the official electron documentation. Later I'll add a |
This is fantastic work @GabrielBB! |
Since I ended up here and I figured others might as well, this is my solution: jobs:
build:
env:
DISPLAY: :0
steps:
- name: Setup xvfb (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get install -y xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0
# start xvfb in the background
sudo /usr/bin/Xvfb $DISPLAY -screen 0 1280x1024x24 & I used this to test a PyQt5 application. |
We have 84 times this kind of exceptions in 'ajde' tests in our build logs on GitHub, even though the tests seem to pass: HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it. I found this discussion: juliangruber/browser-run#147 And then this GitHub Action: https://github.com/marketplace/actions/gabrielbb-xvfb-action Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* update tslib dependency in packages/*/package.json * add Makefile to .editorconfig * update packages and lerna config * update base tsconfig target to ES6 * add several Makefile targets and tools/build.mk with sample esbuild config * rough-out makefiles with peer dependency compilation * change peer dependencies to newlines that seem to work better with Makefile targets * Update make targets for proper Makefile cross-package dependencies * add the commonjs/esm targets * add tools for the package template * remove references to config.yaml * update Makefile for repackaging; pull package version from lerna.json (for now) * repackage all package.json files .. removing `scripts`, `standard`, and other unused package.json fields * remove `standard` from `repackage` * improve logging and peer dependency checking * Remove numerous references to rollup ... and the many workarounds that are now replaced by esbuild * make) update the Makefile `test` targets and add test_{package} * update repackage to export "." and "./helpers" * repackage with dist/index.js as esm import, dist/index.cjs commonjs * Fix build/peer dependencies building * Fix karma testing config for esbuild * Fix top-level Makefile packaging * Fix utils.jsx imports / dependencies * make) add esm dependency to testing; add watch target * change spec imports from ../src to ../dist ... so we don't have a double-import problem * consolidate the karma config to tools/karma.conf.js * fix builder missing karma/frameworks * tools) fix broken ../{pkg}/dist/*.js * Move packages/build.knockout to builds/knockout * Move packages/build.reference to builds/reference * Fix tests hanging b/c packages/builder had none * set global export for ko; update knockout builds * Add a stub for commonjs=>iife exports * Add BUILD_VERSION to the exports * tools) Update & simplify our repackaging with lerna * add builds/* to the workspaces/clean target also remove unneeded targets * fix iife/browser build & BUILD_VERSION * more fixes of BUILD_VERSION * build/reference) add tests of iife/root imports * root) add workspaces builds/; add lerna stream comments * fix ReferenceError with globals * make/tools) remove peer_dependenicies in lieu of lerna build * ci) switch to the circleci orb for saucelabs * Updated config.yml * ci) add job * ci) add `make ci` target and Github workflow * ci) fix make target * bind) clean up some imports * ci) remove peer devDependencies from the monorepo that are used for tests ... because lerna seems to order its topology by dependencies and devDependencies as equivalent * make) change lerna concurrency to a variable * Merge branch '130-1-package-update' of github.com:knockout/tko into 130-1-package-update * Revert "ci) remove peer devDependencies from the monorepo that are used for tests" This reverts commit b2fcedf. * ci) use concurrency=1 for build/exec * ci) change devDependencies to dependencies or peerDependencies ... to avoid circular loops in the Lerna topology algorithm * make) ensure that the node_modules is built * workflows) switch to node 16 * ci) add sauce env vars * ci) remove package-lock.json dupe; start to simplify SauceLabs config * ci) disable startConnect by default * ci) disable Safari as it always tseems to time out * ci) disable SauceLabs, enable local testing ... so we're no longer blocked * ci) disable SL on pull; set test concurrency=1 * ci) try xvfb-run on Github actions per: juliangruber/browser-run#147 * ci) install electron / npm * ci) try GabrielBB/xvfb-action tests * ci) switch back to SauceLabs w/o recording/screenshots ... also set test concurrency to 1 * ci) disable CI altogether until we DD it
I tried to install/configure
xvfb
on GitHub actions to usebrowser-run
/tape-run
there, but I was not successful.If anyone finds a solution, please advise. This is the simplest configuration that's only missing
xvfb
I wrote all of this and it exits with
0
butbrowser-run
doesn't output anything. The code is not run at all, invalid JS will also result inbrowser-run
exiting successfully.The text was updated successfully, but these errors were encountered: